package code;

import java.util.regex.Pattern;

public final class DateFormat {
	private final String		format;
	private final String		regex;

	public final static String	yyyyMMddUnder	= "yyyy_MM_dd";
	public final static String	yyyyMMddDash	= "yyyy-MM-dd";
	public final static String	yyyyMM			= "yyyyMM";

	public DateFormat(String format, String regex) {
		this.format = format;
		this.regex = regex;
	}

	public String getFormat() {
		return format;
	}

	public String getRegex() {
		return regex;
	}

	public boolean matches(String input) {
		return Pattern.matches(regex, input);
	}

	@Override
	public String toString() {
		return "yyyy-MM-dd";
	}
}
